package com.yn.module.material.utils;

/**
 * @description:
 * @author: 叶甯
 * @create: 2022/10/14 09:24
 * @since: 1.0.0
 * @copyright (C), 2022, https://gitee.com/johnny .All rights reserved.
 */
public class StringUtils {
    /**
     * object对象转为str
     *
     * @param obj
     * @param defaultValue
     * @return
     */
    public static String obj2str(Object obj, String defaultValue) {
        if (obj == null) return defaultValue;
        return String.valueOf(obj);
    }

    public static String obj2str(Object obj) {
        return obj2str(obj, "");
    }
}
